<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
    <meta http-equiv="Pragma" content="no-cache" />
    <meta http-equiv="Expires" content="0" />
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=2.0, user-scalable=no"/>
<title>全国少儿世界和平海报大赛</title>
<link href="/Public/css/maint.css" type="text/css" rel="stylesheet" />
<link href="/Public/css/font.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="/Public/js/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="/Public/js/common.js"></script>
<script type="text/javascript" src="/Public/js/page.js"></script>
<script type="text/javascript" src="/Public/js/main.js"></script>

<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>

</head>	
<body style="background-color:#f2f2f2">
<div style="display:none">
    <img src="{$result['pic']}" width="200px" height="200px"/>
</div>
<div class="mask"></div>
<div class="share"></div>
<div class="ewms">
	<span class="icon iconfont icon-chahao closeEwm"></span>
	<h1 class="h1ewms">二维码拉票</h1>
    <div class="divewmImg"><img src="/Public/images/qrcode.jpg" width="100%"></div>
	<p class="pewm">微信扫描此二维码，让亲朋好友给{$result['author_name']}小朋友投票</p>
</div>
<div id="main" class="bot50">
	<div class="contBox1">
		<div class="contentTitle"><a href="{:U('Wap/PraiseItem/index', array('praise'=>$praise))}" target="_self"><span class="icon iconfont icon-fanhui backBtn"></span></a>{$result['id']}号作品：{$result['show_name']}</div>
	<img src="{$result['pic']}"  class="contentImg">
    <div class="stateForm">
    <div class="weixinAlert" id="voteSuccess">
    	<p class="pVote">投票成功！您今天还剩余5次</p>
        <div class="voteSure">确定</div>
    </div>
    <div class="weixinAlert" id="voteResourceOut" >
    	<p class="pVote">今天投票数量已用完，明天再来吧！</p>
        <div class="voteSure">确定</div>
    </div>
    
    </div>
    <div class="divConBtn bot10">
         <span class="zpinfo">
			 <span class="zpAuthor">制作人员：{$result['author_name']}</span>
             <!-- <if condition="!empty( $result['teacher_name'] )" >
                 <span class="zpTeacher">部门：{$result['teacher_name']}</span>
             </if> -->
        </span>
        <span class="zpinfo">
			<span>制作部门：{$result['school_name']}</span>
        </span>
        <span class="zpinfo">
			<span class="zpNum">编号：{$result['id']}</span>
			<span class="zpRank">排名：<em>{$rank['index']}</em></span>
        </span>
        <div class="divskillBar">
			<div class="skillbar clearfix" data-percent="{$rank['percent']}">
                <div class="skillbar-bar"></div>
        	</div>
			<p class="pSkillBar">当前票数：<em>{$result['votes']}</em>票，距前一名还差<em>{$rank['gap']}</em>票！</p>
        </div>
        <if condition="$checked eq 1">
            <div class="votebtn" data-item="{$result['id']}" data-praise="{$result['praise_id']}">给TA投票</div>
            <else />
            <div class="votebtn graybtn" data-item="{$result['id']}" data-praise="{$result['praise_id']}">给TA投票</div>
        </if>
    </div>
    <div class="divShare">
    	<div class="shareAll">
            <span class="shareBtn">分享给好友</span>
            <span class="shareBtn lpBtn">帮TA拉票</span>
        </div>
    </div>
</div>
<include file="Tpl/h5_footer" praise="{$praise}"/>

<script type="text/javascript">	
	page.praise.init();
</script>
<script type="text/javascript">
        wx.config({
            debug: false, //
            appId: '{$wxuser["appid"]}', // 必填，公众号的唯一标识
            timestamp: "{$timestamp}", // 必填，生成签名的时间戳
            nonceStr: '{$nonceStr}', // 必填，生成签名的随机串
            signature: '{$wxSha1}',// 必填，签名，见附录1
            jsApiList: ['onMenuShareAppMessage','onMenuShareTimeline'] // 必填，需要使用的JS接口列表，所有JS接口列表见附录2
        });
        wx.error(function(res){
            //console.log(res);
    		// config信息验证失败会执行error函数，如签名过期导致验证失败，具体错误信息可以打开config的debug模式查看，也可以在返回的res参数中查看，对于SPA可以在这里更新签名。
        });
        
        wx.ready( function( e ){
        	wx.onMenuShareAppMessage({
			    title: "{$share['title']}", // 分享标题
			    desc: "{$share['desc']}", // 分享描述
			    link: "{$share['link']}", // 分享链接
			    imgUrl: "{$share['imgUrl']}", // 分享图标
			    type: 'link', // 分享类型,music、video或link，不填默认为link
			    dataUrl: '', // 如果type是music或video，则要提供数据链接，默认为空
			    success: function () {
			        // 用户确认分享后执行的回调函数
			    },
			    cancel: function () {
			        // 用户取消分享后执行的回调函数
			    }
			});
			wx.onMenuShareTimeline({
			    title: "{$share['title']}", // 分享标题
			    link: "{$share['link']}", // 分享链接
			    imgUrl: "{$share['imgUrl']}", // 分享图标
                //imgUrl: "{$result['pic']}", // 分享图标
                //imgUrl: "http://www.zjdaily.org/Public/Uploads/thumb.jpg", // 分享图标
			    success: function () {
			        // 用户确认分享后执行的回调函数
			    },
			    cancel: function () {
			        // 用户取消分享后执行的回调函数
			    }
			});
        })
</script>
</body>
</html>
